import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    //三角形
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            double a = in.nextDouble();
            double b = in.nextDouble();
            double c = in.nextDouble();
            if(a + b > c && a + c > b && b + c > a){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }
    }

    //不用加减乘除做加法
    public int Add(int num1,int num2) {
        while(num2 != 0){
            int tmp = num1 ^ num2;
            num2 = (num1 & num2) << 1;
            num1 = tmp;
        }
        return num1;
    }
    //跳跃游戏(动规)
    public static int jump(int[] nums) {
        int len = nums.length;
        if(len == 1) return 0;
        //dp[i]:从0位置起，到达i位置时的最小跳跃次数
        int[] dp = new int[len];
        for(int i = 1; i < len; i++){
            int min = Integer.MAX_VALUE;
            for(int j = 0; j < i; j++){
                if(nums[j] + j >= i && min > dp[j] + 1){
                    min = dp[j] + 1;
                }
            }
            dp[i] = min;
        }
        return dp[len-1];
    }

    //加油站(暴力枚举 超时)
    public int canCompleteCircuit1(int[] gas, int[] cost) {
        int len = gas.length;
        for(int i = 0; i < len; i++){
            gas[i] = gas[i] - cost[i];
        }
        //暴力枚举
        for(int i = 0; i < len; i++){
            //判断当前能否出发
            if(gas[i] < 0) continue;
            //判断从当前出发是否能循环一周
            int flg = 1;
            int sum = gas[i], j = (i + 1) % len;
            for(int step = 0; step < len; step++){
                if(sum < 0){
                    flg = 0;
                    break;
                }
                sum += gas[j];
                j = (j + 1) % len;
            }
            if(flg == 1){
                return i;
            }
        }
        return -1;
    }
    //加油站(贪心优化)
    public static int canCompleteCircuit(int[] gas, int[] cost) {
        int len = gas.length;
        for(int i = 0; i < len; i++){
            gas[i] = gas[i] - cost[i];
        }
        for(int i = 0; i < len; i++){
            //判断当前能否出发
            if(gas[i] < 0) continue;
            //判断从当前出发是否能循环一周
            int flg = 1;
            int sum = gas[i], j = (i + 1) % len;
            int step = 0;
            for(; step < len; step++){
                sum += gas[j];
                if(sum < 0){
                    flg = 0;
                    break;
                }
                j = (j + 1) % len;
            }
            if(flg == 1){
                return i;
            }else{
                i = step + i + 1;
            }
        }
        return -1;
    }
    //单调递增的数字(暴力枚举 超时)
    public static int monotoneIncreasingDigits1(int n) {
        //暴力枚举
        for(int i = n; i > 0; i--){
            if(judge(i)){
                return i;
            }
        }
        return 0;
    }
    public static boolean judge(int n){
        StringBuilder ret = new StringBuilder();
        ret.append(n);
        for(int i = 1; i < ret.length(); i++){
            if(ret.charAt(i) < ret.charAt(i-1)) return false;
        }
        return true;
    }
    //单调递增的数字(贪心优化)
    public static int monotoneIncreasingDigits(int n) {
        String s = "";
        s += n;
        char[] num = s.toCharArray();
        int len = s.length();
        for(int i = 0; i < len - 1; i++){
            if(num[i + 1] < num[i]){//出现递减的情况
                int k = 0;
                for(int j = i - 1; j >= 0; j--){
                    if(num[j] < num[i]){
                        k = j + 1;
                        break;
                    }
                }
                num[k] = (char) (num[k] - 1);
                k += 1;
                for(; k < len; k++){
                    num[k] = '9';
                }
                break;
            }
        }
        return Integer.parseInt(new String(num));
    }
    //坏了的计算器
    public int brokenCalc(int startValue, int target) {
        int count = 0;
        while(target != startValue){
            if(target < startValue){
                target++;
            }else{
                if(target % 2 == 1){
                    target += 1;
                }else{
                    target /= 2;
                }
            }
            count++;
        }
        return count;
    }
    //合并区间
    public int[][] merge(int[][] intervals) {
        //先排序(以左端点升序排)
        Arrays.sort(intervals, (a, b) ->{
            return a[0] - b[0];
        });
        List<int[]> list = new ArrayList<>();

        int left = intervals[0][0], right = intervals[0][1];
        for(int i = 1; i < intervals.length; i++){
            if(intervals[i][0] <= right){//重叠
                right = Math.max(intervals[i][1], right);
            }else {//不重叠
                list.add(new int[]{left, right});
                left = intervals[i][0];
                right = intervals[i][1];
            }
        }
        list.add(new int[]{left, right});//最后一个区间
        return list.toArray(new int[list.size()][]);
    }
    //无重叠区间
    public int eraseOverlapIntervals(int[][] intervals) {
        Arrays.sort(intervals, (a, b) ->{
            return a[0] - b[0];
        });
        int right = intervals[0][1];
        int count = 0;
        for(int i = 1; i < intervals.length; i++){
            if(intervals[i][0] < right){
                count++;
                right = Math.min(right, intervals[i][1]);
            }else{
                right = intervals[i][1];
            }
        }
        return count;
    }
    //用最少数量的箭引爆气球
    public static int findMinArrowShots(int[][] points) {
        Arrays.sort(points, (a, b) ->{
            if(a[0] > b[0]){
                return -1;
            }else if(a[0] < b[0]){
                return -1;
            }else {
                return 0;
            }
        });
        int left = points[0][0], right = points[0][1];
        int count = 0;
        for(int i = 1; i < points.length; i++){
            if(points[i][0] <= right){
                left = Math.max(points[i][0], left);
                right = Math.min(points[i][1], right);
            }else{
                count++;
                left = points[i][0];
                right = points[i][1];
            }
        }
        count += 1;
        return count;
    }

    public static void main(String[] args) {
        int[][] points = {{-2147483646,-2147483645},{2147483646,2147483647}};
        findMinArrowShots(points);
        int[] nums = {5,8,2,8};
        int[] cost = {6,5,6,6};
        monotoneIncreasingDigits(332);
        canCompleteCircuit(nums, cost);
        jump(nums);
        System.out.println(jump(nums));
    }
}